/*
 * Gsoft开发框架
 * Copyright 2015-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.itcs.rongyun.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * TODO (描述该文件做什么)
 * 
 * @author LiuPeng
 * @date 2017年12月9日
 * 
 */
public class MessageUtils {

	/**
	 * 组装广播message
	 * 
	 * @param content
	 *            发送消息内容，参考融云 Server API 消息类型表. 示例说明；如果 objectName
	 *            为自定义消息类型，该参数可自定义格式。（必传）
	 * 
	 * @param objectName
	 *            消息类型，参考融云 Server API 消息类型表. 消息标志；可自定义消息类型，长度不超过 32 个字符。（必传）
	 * @return
	 */
	public static Map<String, Object> buildMessage(String content, String objectName) {
		Map<String, Object> message = new HashMap<>();
		message.put("objectName", objectName);
		message.put("content", content);
		return message;
	}

	/**
	 * 组装广播message
	 * 
	 * @param content
	 *            发送消息内容，参考融云 Server API 消息类型表. 示例说明；如果 objectName
	 *            为自定义消息类型，该参数可自定义格式。（必传）
	 * @return
	 */
	public static Map<String, Object> buildMessage(String content) {
		return buildMessage(content, "RC:TxtMsg");
	}
}
